package com.jintoufs.service.baseinfo;

import com.jintoufs.dao.QueryFilters;
import com.jintoufs.domain.baseinfo.CurrencyExchange;
import org.cosmos.modules.web.msg.AjaxMsg;

import java.util.List;
import java.util.Map;

public interface CurrencyExchangeService {
    void deleteByPrimaryKey(Integer id);

    /**
     * 插入数据，如果实体已经存在则进行更新
     *
     * @param record 实体
     * @return ajaxmsg
     */
    AjaxMsg insert(CurrencyExchange record);

    CurrencyExchange selectByPrimaryKey(Integer id);

    void updateByPrimaryKey(CurrencyExchange record);

    List<Map<String, Object>> queryByParams(Map<String, Object> params);

    List<CurrencyExchange> queryByCurrencyExchange(Map<String, Object> params);

    List<Map<String, Object>> getByFilter(QueryFilters filters);

    /**
     * 获取汇率
     *
     * @param params {scur:源币种 tcur：目标币种}
     * @return 汇率
     */
    Double queryRateByParams(Map<String, Object> params);

    /**
     * 获取汇率
     *
     * @param scur:源币种
     * @param tcur：目标币种
     * @return 汇率
     */
    Double queryRate(String scur, String tcur);
}